import 'package:flutter/material.dart';
import 'package:heyangkuaidai/DemonStrateModule/Components/NavigationBar.dart';
import 'package:flutter_screenutil/screenutil.dart';
import 'package:heyangkuaidai/DemonStrateModule/Components/AccountBankCardItem.dart';
import 'AccountFindDetailPage.dart';
class AccountFindPage extends StatefulWidget {
  @override
  _AccountFindPageState createState() => _AccountFindPageState();
}

class _AccountFindPageState extends State<AccountFindPage> {
  @override
  Widget build(BuildContext context) {
    ScreenUtil.init(context, width: 375, height: 667, allowFontScaling: true);
    return Scaffold(
      body: Column(
        children: [
          SizedBox(height: MediaQuery.of(context).padding.top,),
          NavigationBar(false, title: "账户查询",),
          Container(
            height: ScreenUtil().setWidth(500),
            width: ScreenUtil.screenWidth,
            child:ListView.separated(
              padding: EdgeInsets.only(top: 0,left: ScreenUtil().setWidth(20),right: ScreenUtil().setWidth(20)),
                itemBuilder: (context,index) {
                if(index ==0) {
                  return InkWell(
                    onTap: (){
                      Navigator.push(
                        context,
                        new MaterialPageRoute(
                          builder: (context) => new AccountFindDetailPage(),
                        ),
                      );
                    },
                    child: AccountBankCardItem() ,
                  );
                }else{
                  return Column(
                    children: [
                      SizedBox(height: ScreenUtil().setWidth(15),),
                      Container(
                        color: Color(0xffEBEBEB),
                        width: ScreenUtil().setWidth(345),
                        height: ScreenUtil().setWidth(45),
                        child: Row(
                          children: [
                            SizedBox(width:ScreenUtil().setWidth(129) ,),
                            Container(
                              width: ScreenUtil().setWidth(18),
                              height: ScreenUtil().setWidth(18),
                              child: Image.asset("sources/yy/add.png",),
                            ),
                            SizedBox(width: ScreenUtil().setWidth(10),),
                            Container(
                              child:Text("添加账户",style: TextStyle(fontSize: ScreenUtil().setSp(15),color: Color(0xff999999)),) ,
                            )
                          ],
                        ),
                      )
                    ],
                  );
                }
            }, separatorBuilder: (context,index){
              return Container();
            }, itemCount: 2) ,
          ),

        ],
      ),
    );
  }
}
